/*
** header_error.c for asm in /home/vanet_c//proj-kw/asm/folder_syntax
** 
** Made by charles-edouard vanet
** Login   <vanet_c@epitech.net>
** 
** Started on  Fri Dec 14 14:47:43 2012 charles-edouard vanet
** Last update Fri Dec 14 14:47:45 2012 charles-edouard vanet
*/

#include	"../../includes/asm.h"

void	header_msg(t_list **list, t_my_file **my_file, int type)
{
  if (type == 1)
    if (my_strlen((*my_file)->tab_instruction[1]) > PROG_NAME_LENGTH)
      {
	my_stderror((*list)->name);
	my_stderror(" : too long program name length line ");
	my_put_nbr_error((*my_file)->line_nb);
	my_fd_putchar('\n', 2);
	my_free_list(*list);
	exit(EXIT_FAILURE);
      }
  if (type == 2)
    if (my_strlen((*my_file)->tab_instruction[1]) > COMMENT_LENGTH)
      {
	my_stderror((*list)->name);
	my_stderror(" : too long comment length line ");
	my_put_nbr_error((*my_file)->line_nb);
	my_fd_putchar('\n', 2);
	my_free_list(*list);
	exit(EXIT_FAILURE);
      }
}
